<script setup>
// This starter template is using Vue 3 <script setup> SFCs
// Check out https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup
import { nextTick, onMounted } from 'vue'
import { useStore } from 'vuex'
import { useRouter, useRoute, onBeforeRouteUpdate } from 'vue-router'
import profile from './profile'
import zhCn from 'element-plus/lib/locale/lang/zh-cn'

const router = useRouter()
const route = useRoute()
const store = useStore()

onMounted(async() => {
  store.commit('windowWidth', window.innerWidth)
  window.onresize = () => {
    store.commit('windowWidth', window.innerWidth)
  }
  console.log(import.meta.env)
  const res = await profile(router, route, store)
  console.log(res)
})

</script>

<template>
  <el-config-provider :locale="zhCn">
    <router-view></router-view>
  </el-config-provider>
</template>

<style>
  html,body {
    height: 100%;
    margin: 0;
  }
  #app {
    height: 100%;
  }
</style>
